<!--
 * @Author: yuanlai
 * @Date: 2024-08-16 16:06:49
 * @LastEditors: yuanlai
 * @LastEditTime: 2024-08-16 19:41:23
 * @Description: 组件二次封装
-->
<template>
    <div class="container">
        <h3>组件二次封装</h3>
        <p>原组件：</p>
        <el-table :data="tableData" style="width: 100%">
            <el-table-column prop="date" label="日期" width="180">
                <template #default="{ row }">
                    {{ row.date }}
                </template>
            </el-table-column>
        </el-table>
        <p>封装组件：</p>
        <el-table :data="tableData" style="width: 100%">
            <b-table-column label="日期" prop="date" width="180">
            </b-table-column>
        </el-table>
    </div>
</template>

<script>
import bTableColumn from '@/components/bTableColumn.vue'
export default {
    name: "demo1",
    components: {
        bTableColumn
    },
    data() {
        return {
            tableData: [{
                date: '2016-05-02',
                name: '王小虎',
                address: '上海市普陀区金沙江路 1518 弄'
            }, {
                date: '2016-05-04',
                name: '王小虎',
                address: '上海市普陀区金沙江路 1517 弄'
            }, {
                date: '2016-05-01',
                name: '王小虎',
                address: '上海市普陀区金沙江路 1519 弄'
            }, {
                date: '2016-05-03',
                name: '王小虎',
                address: '上海市普陀区金沙江路 1516 弄'
            }]
        }
    },
    mounted() {
        // this.$refs.inputRef1.focus()
        // this.$refs.inputRef2.focus()
    },
    methods: {
        onInputChange(v) {
            console.log(v)
        }
    }
}
</script>

<style lang="scss" scoped>
.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
</style>